﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DeveloperSite.Master" AutoEventWireup="true" 
    CodeBehind="Archived_Project_Reports.aspx.cs" Inherits="Amkeni_System.Archived_Project_Reports" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<asp:EntityDataSource ID="ArchivedProjectsDataSource" runat="server" 
        ConnectionString="name=Amkeni_DatabaseEntities" DefaultContainerName="Amkeni_DatabaseEntities" 
        EnableFlattening="False" EntitySetName="ip_report"
        Include="year, report_period, implementing_partner, RFP" 
        AutoGenerateWhereClause="True" EnableDelete="True" EnableInsert="True" 
        EnableUpdate="True">
        <WhereParameters>
            <asp:Parameter DefaultValue="true" Name="archived" Type="Boolean" />
        </WhereParameters>
</asp:EntityDataSource>

    <asp:Label ID="Error" runat="server" Text="" Visible="false"></asp:Label>
    <asp:Label ID="ContextLabel" runat="server" Text="REPORT LIBRARY" CssClass="ContentHead"></asp:Label>

    <% if (User.IsInRole("Administrator"))
       { %>
       
       <asp:GridView ID="ArchivedProjectsGridView1" runat="server" 
        DataSourceID="ArchivedProjectsDataSource" AutoGenerateColumns="false" 
        CssClass="NewGrid" ShowFooter="true" 
        DataKeyNames="ip_id, year_id, report_period_id, RFP_id" 
        OnRowCommand="ArchivedProjectsGridView1_RowCommand">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <FooterStyle CssClass="NewGridFooter" />
        <Columns>
            <asp:TemplateField HeaderText="CALL">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" TexT='<%# Eval("RFP.RFP_name") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            <asp:TemplateField HeaderText="YEAR">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("year.year1") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="QUARTER">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("report_period.period") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="IMPLEMENTING PARTNER" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="400px">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Eval("implementing_partner.name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <%--<asp:ButtonField ButtonType="Button" CommandName="return" Text="Return to CO" HeaderText="RETURN" />--%>
            <asp:ButtonField ButtonType="Button" CommandName="pdf" Text="PDF" HeaderText="DOWNLOAD" />

        </Columns>
    </asp:GridView>

       <% }
       else
       { %>
       
       <asp:GridView ID="ArchivedProjectsGridView2" runat="server" 
        DataSourceID="ArchivedProjectsDataSource" AutoGenerateColumns="false" 
        CssClass="NewGrid" ShowFooter="true" 
        DataKeyNames="ip_id, year_id, report_period_id, RFP_id" 
        OnRowCommand="ArchivedProjectsGridView2_RowCommand">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <FooterStyle CssClass="NewGridFooter" />
        <Columns>
            <asp:TemplateField HeaderText="CALL">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" TexT='<%# Eval("RFP.RFP_name") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            <asp:TemplateField HeaderText="YEAR">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("year.year1") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="QUARTER">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("report_period.period") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="IMPLEMENTING PARTNER" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="400px">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Eval("implementing_partner.name") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:ButtonField ButtonType="Button" CommandName="pdf" Text="PDF" HeaderText="DOWNLOAD" />

        </Columns>
    </asp:GridView>

       <% } %>

    <%--<asp:GridView ID="ArchivedProjectsGridView" runat="server" 
        DataSourceID="ArchivedProjectsDataSource" AutoGenerateColumns="false" 
        CssClass="NewGrid" ShowFooter="true" 
        DataKeyNames="project_id, year_id, report_period_id" 
        OnRowCommand="ArchivedProjectsGridView_RowCommand">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <FooterStyle CssClass="NewGridFooter" />
        <Columns>
            <asp:TemplateField HeaderText="YEAR">
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("year.year1") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="QUARTER">
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Eval("report_period.report_period1") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="PROJECT" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="400px">
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Eval("project.project1") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:ButtonField ButtonType="Button" CommandName="pdf" Text="PDF" HeaderText="DOWNLOAD" />

        </Columns>
    </asp:GridView>--%>

    <%--<p>
        <asp:Label ID="ProjectLabel" runat="server" Text=""></asp:Label><br />
        <asp:Label ID="ReportPeriodLabel" runat="server" Text=""></asp:Label><br />
        <asp:Label ID="YearLabel" runat="server" Text=""></asp:Label>
    </p>--%>

</asp:Content>
